//== SAGITTARIUS ============================================================================

//== BEGINNING OF CODE ===============================================================

#ifndef __SAGUTTARUIS__THREAD__H_
#define __SAGUTTARUIS__THREAD__H_

//== INCLUDES ========================================================================

#include "sagittarius/core/SagittariusCore.h"

#if SAGITTARIUS_IS_POSIX_VAR
    typedef long spawnresult;
#elif SAGITTARIUS_PLATFORM == SAGITTARIUS_PLATFORM_WIN
    #include <windows.h>
    typedef HANDLE spawnresult;
#else
#   error "Threading not supported on this platform"
#endif

#ifdef __cplusplus
extern "C" {
#endif

//#define SG_MAXTHR 20

//#define SG_N_CURR_THREAD get_n_current_thr()

//used to tell client if spawn was successful or not
int spawn_successful(spawnresult r);

//wrapper for OS thread spawning function
spawnresult sg_spawn(void (*thread_func)(void*), void* param);

void sg_exit_thread(uint64 v);

//int get_n_current_thr();

#ifdef __cplusplus
}//extern "C"
#endif

#endif
